home *** CD-ROM | disk | FTP | other *** search
/ Power DOS 1996 July / Power DOS - July 1996.iso / sound / c_labs / devinfo / mpu401.exe / MIDIUTIL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-18  |  2.8 KB  |  73 lines

  1. /* -------------------------------------------------------------------------- */
  2. /* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY      */
  3. /* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE        */
  4. /* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR      */
  5. /* PURPOSE.                                                                   */
  6. /*                                                                            */
  7. /* You have a royalty-free right to use, modify, reproduce and                */
  8. /* distribute the Sample Files (and/or any modified version) in               */
  9. /* any way you find useful, provided that you agree that                      */
  10. /* Creative has no warranty obligations or liability for any Sample Files.    */
  11. /*----------------------------------------------------------------------------*/
  12.  
  13.  
  14. /* ---------------------------------------------------------------------------
  15.   Program:  Sound Blaster 16 MIDI Utilities
  16.   Filename: MIDIUTIL.H
  17.   Author:   Scott E. Sindorf
  18.   Language: Borland C
  19.   Date:     30 Jun 93
  20.   
  21.   Copyright (c) 1993 Creative Labs, Inc.
  22. -----------------------------------------------------------------------------*/
  23.  
  24. // MIDI flag choices
  25.  
  26. #define SBMIDI          0
  27. #define MPU401          1
  28.  
  29. // MPU-401 definitions
  30.  
  31. #define MPU401_RESET    0xff
  32. #define MPU401_UART     0x3f
  33. #define MPU401_CMDOK    0xfe
  34. #define MPU401_OK2WR    0x40
  35. #define MPU401_OK2RD    0x80
  36.  
  37. // SB-MIDI definitions
  38.  
  39. #define MIDI_IN_P       0x30              // MIDI read (polling mode)
  40. #define MIDI_IN_I       0x31              // MIDI read (interrupt mode)
  41. #define MIDI_UART_P     0x34              // MIDI UART mode (polling mode)
  42. #define MIDI_UART_I     0x35              // MIDI UART mode (interrupt mode)
  43. #define MIDI_UART_TS_P  0x36              // same as 0x34 with timestamp
  44. #define MIDI_UART_TS_I  0x37              // same as 0x35 with timestamp
  45. #define MIDI_OUT_P      0x38              // MIDI write (polling mode)
  46.  
  47. #define ERROR           -1
  48. #define OK              0
  49. #define ON              1
  50. #define OFF             0
  51.  
  52. extern int MIDIType;
  53.  
  54. //------------------------
  55. // FUNCTION DECLARATIONS
  56. //------------------------
  57.  
  58. void Write_MPU401_Cmd(unsigned char command);
  59. void Write_MPU401_Data(unsigned char data);
  60. void Write_SBMIDI_Data(unsigned char data);
  61. unsigned char Read_MPU401_Data(void);
  62. unsigned char Read_SBMIDI_Data(void);
  63. void Send_MIDI_Message(char far *message, int size);
  64.  
  65. void Set_MIDI_Vol(char channel, char volume);
  66. void Set_MIDI_Notes_Off(char channel);
  67. void Set_MIDI_Pitch_Bend(char channel, int range);
  68. int Reset_MPU401(void);
  69. int Set_UART_Mode(int state);
  70. int Detect_MIDI(void);
  71. int Init_MIDI(void);
  72. void Exit_MIDI(void);
  73.